Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Isomorphic pythonVariableRequester and debuggerVariables.ts #10142

Merged
merged 7 commits into from
May 26, 2022

Conversation

sadasant
Copy link
Contributor

@sadasant sadasant commented May 26, 2022

This PR is a continuation of #10092

In this PR, rather than making the constants.node.ts work with URIs, I'm removing any reference to the root in that file and moving those references to the node file, and I'm also using these on the pythonVariableRequester to make non-node-specific.

How far from the goalpost am I in this PR?
Any feedback appreciated.

If this approach is ok, this might be my last PR before the web variable viewer.


Update: Thanks to the feedback provided now I have also made debuggerVariables isomorphic!

@sadasant sadasant self-assigned this May 26, 2022
@codecov-commenter
Copy link

codecov-commenter commented May 26, 2022

Codecov Report

Merging #10142 (e5cf36f) into main (2f5f881) will increase coverage by 5%.
The diff coverage is 100%.

❗ Current head e5cf36f differs from pull request most recent head 6789619. Consider uploading reports for the commit 6789619 to get more accurate results

@@          Coverage Diff           @@
##           main   #10142    +/-   ##
======================================
+ Coverage    55%      61%    +5%     
======================================
  Files       203      203            
  Lines      9238     9237     -1     
  Branches   1490     1490            
======================================
+ Hits       5099     5636   +537     
+ Misses     3737     3126   -611     
- Partials    402      475    +73     
Impacted Files Coverage Δ
src/platform/common/scriptConstants.ts 100% <100%> (ø)
src/platform/common/types.ts 100% <0%> (ø)
src/platform/common/configSettings.ts 80% <0%> (+<1%) ⬆️
src/platform/common/utils/decorators.ts 82% <0%> (+<1%) ⬆️
src/platform/common/variables/environment.node.ts 95% <0%> (+1%) ⬆️
...ommon/process/environmentActivationService.node.ts 45% <0%> (+1%) ⬆️
src/platform/common/cancellation.ts 55% <0%> (+1%) ⬆️
src/platform/ioc/serviceManager.ts 44% <0%> (+2%) ⬆️
src/platform/common/utils/misc.ts 61% <0%> (+2%) ⬆️
...mon/variables/environmentVariablesProvider.node.ts 72% <0%> (+2%) ⬆️
... and 40 more

@sadasant sadasant changed the title Proposal: Isomorphic pythonVariableRequester Proposal: Isomorphic pythonVariableRequester and debuggerVariables.ts May 26, 2022
@sadasant sadasant requested a review from IanMatthewHuff May 26, 2022 17:19
@sadasant sadasant marked this pull request as ready for review May 26, 2022 17:19
@sadasant sadasant requested a review from a team as a code owner May 26, 2022 17:19
@@ -116,7 +119,7 @@ export class DebuggerVariables
if (this.active) {
// Note, full variable results isn't necessary for this call. It only really needs the variable value.
const result = this.lastKnownVariables.find((v) => v.name === name);
if (result && kernel?.resourceUri?.fsPath.endsWith('.ipynb')) {
if (result && kernel?.resourceUri?.path.endsWith('.ipynb')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was part of the existing code already and I don't think that it's much of an issue. But since we have the vscode-path path already I think that path.extname is a safer way to get this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that! Thank you!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from that review looks good. Nice work! Approving and you can check out if extpath works here or not.

Copy link
Member

@IanMatthewHuff IanMatthewHuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving with one possible area to checkout.

@sadasant sadasant merged commit 505dc65 into microsoft:main May 26, 2022
@sadasant sadasant deleted the generic-pythonVariableRequester branch May 26, 2022 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants